import com.sun.xml.internal.ws.server.provider.ProviderInvokerTube;

import java.util.Random;
import java.util.Scanner;

import static java.lang.Math.random;
import static java.lang.Math.sqrt;

public class Test {
    /* public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
         System.out.println("请输入月份");
         int  month = sc.nextInt();
         System.out.println("请输入头等舱 0 经济舱 1");
         int seat = sc.nextInt();
         System.out.println("请输入原价");
         double price = sc.nextDouble();
         if(month>=5&&month<=10){
            result(seat,price,0.9,0.85);
         }else if((month>10&&month<=12)||(month>=1&&month<5)){
             result(seat,price,0.7,0.65);
         }

     }

     public static double result(int seat,double price,double v1,double v0) {

         if(seat==1){
             price *=v1;
         }else if(seat==0){
             price *=v0;
         }
     }


    public static void main(String[] args) {

         int count = 0;
        for (int i = 101; i <= 200; i++) {
            int temp = 0;//一定要在循环里
            for(int j = 2;j<=sqrt(i);j++){
                if(i%j==0){
                     temp = 1;
                    break;
                }
            }
            if(temp==0){
                System.out.println(i);
                count++;
            }
        }
        System.out.println(count);

    }


     //随机验证码,前四位随机大小写字母,最后一位数字0~9
     //把前52字母放进数组随机抽取四次拼接
    public static void main(String[] args) {

        char[] chs = new char[52];
        for(int i = 0;i<chs.length;i++) {
            if (i < 26) {
                chs[i] = (char) (97 + i);
            }else{
                chs[i] =( char)(65+i-26);
            }
        }
        String s  = "";
       Random r =new Random();
        for(int i = 0;i<4;i++) {
            int randomIndex = r.nextInt(chs.length - 1);
            s+=chs[randomIndex];
        }
        s+=r.nextInt(10);
        System.out.println(s);
    }


    public static void main(String[] args) {
        int[] array = {1,2,3,4};
        int[] arr = new int[array.length];
        for(int i = 0;i<=array.length-1;i++){
            arr[i] = array[i];
        }
        for(int i = 0;i<arr.length;i++){
            System.out.print(arr[i]+" ");
        }
    }


    public static void main(String[] args) {

        int[] scoreArr = getscores();
        int scoreMin = getMin(scoreArr);
        int scoreMax = getMax(scoreArr);
       int sum = getSum(scoreArr);
        System.out.println((sum-scoreMin-scoreMax)/(scoreArr.length-2));
    }

    public static int[] getscores() {
        int[] scores = new int[6];

        Scanner sc = new Scanner(System.in);

        for (int i = 0; i < scores.length; ) {
            System.out.println("请输入评委的分数:");
            int score = sc.nextInt();
            if (score >= 0 && score <= 100) {
                scores[i++] = score;
            } else {
                System.out.println("不符合条件,请重新输入");
            }
        }
        return scores;
    }

    public static int getMax(int[] scoreArr) {
        int max = scoreArr[0];

        for (int i = 1; i < scoreArr.length; i++) {

            if (scoreArr[i] > max) {
                max = scoreArr[i];

            }

        }
        return max;
    }

    public static int getMin(int[] scoreArr) {
        int min = scoreArr[0];

        for (int i = 1; i < scoreArr.length; i++) {

            if (scoreArr[i] < min) {
                min = scoreArr[i];

            }

        }
        return min;
    }

    public static int getSum(int[] scoreArr) {
        int sum = 0;
        for (int i = 0; i < scoreArr.length; i++) {
            sum+= scoreArr[i];
        }
        return sum;
    }


    public static void main(String[] args) {
        //输入数字
        System.out.println("请输入您要输入的数字");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();

        //判断位数创建数组
        int num = number;
        int count = 0;
        while (num != 0) {
            count++;
            num /= 10;
        }
        int[] arr = new int[count];


        //将每一为数字放在数组中,倒着放
        int index = arr.length - 1;
        while (number != 0) {
            arr[index] = number % 10;
            number /= 10;
            index--;
        }

        for (int i = 0; i < arr.length; i++) {
            arr[i] += 5;
        }

        for (int i = 0; i < arr.length; i++) {
            arr[i] %= 10;
        }

        //将数组元素反转
        for (int i = 0, j = arr.length - 1; i <= j; i++, j--) {
            int temp = arr[i];

            arr[i] = arr[j];
            arr[j] = temp;
        }

        //将数组变成数字
        int number1 = 0;
        for (int i = 0; i < arr.length; i++) {
            number1 = number1 * 10 + arr[i];
        }
        System.out.println(number1);
    }

    public static void main(String[] args) {
        System.out.println("请输入您要输入的数字");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();

        //判断位数创建数组
        int num = number;
        int count = 0;
        while (num != 0) {
            count++;
            num /= 10;
        }
        int[] arr = new int[count];


        //将每一为数字放在数组中
        int index = arr.length - 1;
        while (number != 0) {
            arr[index] = number % 10;
            number /= 10;
            index--;
        }



        //将数组元素反转
        for (int i = 0, j = arr.length - 1; i < j; i++, j--) {
            int temp = arr[i];

            arr[i] = arr[j];
            arr[j] = temp;
        }


        for (int i = 0; i < arr.length; i++) {
           if(arr[i]>=0&&arr[i]<=4){//min=5,max=14
               arr[i] += 10;
           }

        }
        for (int i = 0; i < arr.length; i++) {
            arr[i] -= 5;
        }

        //将数组变成数字
        int number1 = 0;
        for (int i = 0; i < arr.length; i++) {
            number1 = number1 * 10 + arr[i];
        }
        System.out.println(number1);
    }

     */
 /*   public static void main(String[] args) {
        int[] arr ={2,588,888,1000,10000};
        int[] array = new int[arr.length];
        Random r = new Random();
        for(int i = 0;i<arr.length;) {
            int index = r.nextInt(arr.length);
            int prize = arr[index];
            boolean res = contains(prize, array);
            //奖项不存在
            if (!res) {
                array[i++] = prize;
            }
        }
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }
    }

    public static boolean contains(int prize,int[] array) {
        for (int i = 0; i < array.length; i++) {
            if(prize == array[i]){
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        //arr的每个下标与random交换
        int[] arr = {2,588,888,1000,10000};
        Random r= new Random();
        for(int i = 0;i<arr.length;i++){
            int index = r.nextInt(arr.length);
            int temp = arr[i];
            arr[i] = arr[index];
            arr[index] = temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

    public static void main(String[] args) {
        //1.生成中奖号码

    }

    public static int[] createNumber() {
        //创建数组用于添加中间号码
        int[] arr  = new int[7];

        //随机生成号码添加到数组中
        for (int i = 0; i < 6; i++) {
            Random r = new Random();
            int redNumber = r.nextInt(33)+1;
            boolean flag = contains(arr,redNumber);
            if(!flag){
                arr[i] = redNumber;
                i++;
            }
        }
    }
    public static  boolean contains(int[] arr,int number){
        for(int i = 0;i<arr.length;i++){
            if(arr[i]==number ){
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        int[][] arr1 = {
                {1,2,3},
                {2,3,4,5,7}
        };
        int[][] arr2 = new int[2][5];
        arr2[0][0] =  10;
        System.out.println(arr1[1][4]);
        System.out.println(arr1[0][2]);
        for (int i = 0; i < arr1.length; i++) {
            for (int j = 0; j < arr1[i].length; j++) {
                System.out.print(arr1[i][j]+" ");
            }
            System.out.println();
        }
        for (int i = 0; i < arr2.length; i++) {
            for (int j = 0; j < arr2[i].length; j++) {
                System.out.print(arr2[i][j]+" ");
            }
            System.out.println();
        }
    }


    public static void main(String[] args) {
        int[][] array ={
                {22,66,44},
                {77,33,88},
                {25,45,65},
                {11,66,99}
        };
        int yearSum = 0;
        for(int i = 0;i<array.length;i++){
            int[] quartArr = array[i];
            int sum = getSum(quartArr);
            yearSum +=sum;
            System.out.println("第"+(i+1)+"季度营业额:"+sum);

        }
        System.out.println(yearSum);
    }



    public static int getSum(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum +=arr[i];
        }
        return sum;
    }

  */

}
 class Phone{
      String brand;
      double price;
      public void call(){
          System.out.println("用手机打电话");
      }
      public void playgame(){
          System.out.println("用"+this.brand+"手机玩游戏");
      }
}






